﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Chromos.ActionEngine;
using Chromos.AIEngine;

namespace Chromos.Actors
{
	class FlyFish : Enemy
	{
		public FlyFish(Game1 game, Vector2 position, Vector2 velocity, ContentManager content, bool isStatic, string aggressiveness)
			: base(game, position, velocity, content, isStatic,  aggressiveness)
		{
			this.applyGravity = false;
		}

		protected override void initAIEngine()
		{
			aiEngine = new MinionAIEngine(this, "normal", 300);
		}

		protected override void initActorFields()
		{
			base.initActorFields();
			this.mass = 30;
			this.health = 40;
		}

		public override Projectile createProjectiles(int i)
		{
			return null;
		}

		public override void addActions()
		{
			// Add to list enemyAttacks, Defences, and Movements
			IdleAction m1 = new IdleAction(this, content, Vector2.Zero, ForceType.ForceInstant, 50);
			m1.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Move/FishLeft1");
			// Add other images
			m1.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Move/FishLeft2");

			// Contact attack
			AttackAction contactAttL = new AttackAction(this, content, new Vector2(250, 0), ForceType.ForceInstant, 500, null, 40, 40, 30, 800, 0, 100, 0, null, null, FACING.LEFT, true);
			contactAttL.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Move/FishLeft1");
			AttackAction contactAttR = new AttackAction(this, content, new Vector2(-250, 0), ForceType.ForceInstant, 500, null, 40, 40, 30, 800, 0, 100, 0, null, null, FACING.RIGHT, true);
			contactAttR.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Move/FishLeft2");

			// Create other animations
			WalkAction movingLeft = new WalkAction(this, content, new Vector2(-80, 0), ForceType.ForceInstant, 50, FACING.LEFT);
			movingLeft.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Move/FishLeft1");
            movingLeft.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Move/FishLeft2");

			WalkAction movingRight = new WalkAction(this, content, new Vector2(80, 0), ForceType.ForceInstant, 50, FACING.RIGHT);
            movingRight.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Move/FishRight1");
            movingRight.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Move/FishRight2");
            // Add other images for them

			DeathAction death = new DeathAction(this, content, new Vector2(0, 0), ForceType.ForceInstant, 500);
			death.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Death/FishDeath1");
			DeathAction deathFinal = new DeathAction(this, content, new Vector2(0, 0), ForceType.ForceInstant, 500);
			deathFinal.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Death/FishDeath1");
			deathFinal.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Death/FishDeath2");
			deathFinal.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Death/FishDeath3");
			deathFinal.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Death/FishDeath4");
			deathFinal.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Death/FishDeath5");
			deathFinal.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Death/FishDeath6");
			deathFinal.addImageToLoad(@"Sprites/Enemies/BlueUnits/FlyFish/Death/FishDeath7");

			// etc...

			// Add everything to the right action list
			actionEngine.addIdle(m1);
			actionEngine.addMovement(movingLeft);
            actionEngine.addMovement(movingRight);
			actionEngine.addAttack(contactAttL);
			actionEngine.addAttack(contactAttR);
			actionEngine.addDeath(death);
			actionEngine.addDeath(deathFinal);
		}
	}
}
